<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>EdgeX Foundry中文社区</title>
  <link rel="shortcut icon" type="image/x-icon" href="/img/bg_img.png" style="width:62px;height:62px;" />
  <link rel="stylesheet" href="/vendors/bootstrap/css/bootstrap.min.css">
  <link href="/vendors/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/css/main.css">
  <link rel="stylesheet" href="/css/footer.css">
  <style media="screen">
    * {
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }
    a {
      color: inherit;
      text-decoration: none!important;
    }
    .user_profile img {
      width: 51px;
      height: 51px;
      display: inline-block;
      border-radius: 50%;
      border: 1px solid rgba(148, 44, 73, 0.5);
      outline: 0;
    }
    .user_hide_info:hover {
      display: inline-block;
    }
  /*html , body{
    height: 100%;
    min-height: 100%;
  }*/
  </style>

  <style media="screen">
  /* myfooter start */
    .myfooter{
      width: 100%;
      margin-top: 10px;
      padding-top: 10px;
      padding-bottom: 10px;
      background: #343a40;
      text-align: center;
    }

    .copyright{
      width: 420px;
      margin: 0 auto;
      color: #ffffff;
    }

    .copyright img{
      width: 120px;
      height: 60px;
    }

    .copyright span{
      font-size: 14px;
    }

    .fixed-footer{
      position: fixed;
      bottom: 0;
    }

  </style>
</head>

<body style="background-color:#f4f5f5">
  <div class="header">
    <div class="container">
      <div class="row">
        <div class="col-sm-6 col-md-6 col-lg-6">
          <div class="title">
            <a href="/"><i class="fa fa-home fa-fw"></i>EdgeX Foundry中国社区</a>
          </div>
        </div>

        <div class="col-sm-6 col-md-6 col-lg-6" style="text-align:right">
          <div class="header_post">
            <a><span><i class="fa fa-edit fa-fw"></i>发帖</span></a>
          </div>
          <div class="header_user" style="display:none; position:relative!important;">
              <div class="dropdown">
                <img src="" alt="" style="width:22px;height:22px;margin:0;margin-left:5px;padding:0;border-radius:15%;border:1px solid rgb(148, 44, 73, 0.5);">
                <span class="badge" style="display:none;position:relative;left:-10px;top:-10px;background-color:red!important;">99+</span>
                <!-- <span class="caret"></span> -->
                <!-- <div class="user_hide_info" style="position:absolute!important;background-color:white;width:80px;height:120px;border:1px solid green;z-index:999;display:none;">
                  <div class="" style="color:black!important;">
                    消息
                  </div>
                  <div class="" style="color:black!important;">
                    退出
                  </div>
                </div> -->
              </div>

          </div>
          <div class="header_login">
            <a><span><i class="fa fa-sign-up fa-fw"></i>登录</span></a>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="center" id="index_main">
    <div class="container">
      <div class="row">
        <div class="col-sm-12 col-md-12 col-lg-12">
          <div class="welcome">
            <div style="font-size:x-large;font-weight: bold;padding-top:40px;">
              欢迎访问EdgeX Foundry中国社区
            </div>

            <div style="width:800px;margin-top:40px;">国内首个EdgeX Foundry物联网框架的交流社区。EdgeX Foundry是由Dell发起的物联网解决方案，目前EdgeX Foundry属于Linux基金会的首个物联网框架。
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-8 col-md-8 col-lg-8">
          <div class="article_main">
            <span><i class="fa fa-yelp fa-fw" style="color:#942c49;"></i>&nbsp;最新动态</span>
          </div>
          <div class="article_list">

          </div>
          <div class="article_footer">

          </div>
        </div>
        <div class="col-sm-4 col-md-4 col-lg-4">
          <div class="announcement">
            <p style="border-bottom:1px solid #d3bdd0;font-size:medium;"><i class="fa fa-volume-up fa-fw" style="color:#942c49;"></i>&nbsp;网站公告</p>
            <p style="color:rgb(148,44,73);"> EdgeX Foundry中国社区，是国内首个EdgeX Foundry物联网框架的交流社区。EdgeX Foundry是由Dell发起的物联网解决方案，目前EdgeX Foundry属于Linux基金会的首个物联网框架。我们致力于为EdgeX Foundry技术人员提供分享和交流的平台，推动EdgeX Foundry在国内的普及和应用。 欢迎CTO、架构师、开发者等，在这里学习与交流使用EdgeX Foundry的实战经验。
            </p>

          </div>
          <div class="wechat_comm">
            <img src="" alt="">
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- myfooter start -->
      <footer class="myfooter">
          <div class="copyright">
            <p style="color:gray;">EdgeX Foundry中国社区</p>
            <span style="color:gray;"> <a href="http://www.miitbeian.gov.cn/"> © 2018-2019&nbsp; &nbsp; 京ICP备18056168号  </a></span>
          </div>
      </footer>
  <!-- myfooter end -->


  <script type="text/javascript" src="/vendors/jquery/jquery.min.js"></script>
  <script type="text/javascript" src="/js/util.js"></script>
  <script type="text/javascript" src="/js/main.js"></script>
  <script type="text/javascript">

     function loadNewArticleList(){
      $.ajax({
        url:'/api/v1/findNewArticles',
        type:'GET',
        success:function(data){
           renderNewArticleList(data);
        },
        error:function(){

        }
      });
    }
    function renderNewArticleList(articles){
      for (var i = 0; i < articles.length; i++){
        var path = "/articles/users/" + articles[i].userName + "/" + articles[i].id;
        var row = '<div class="article_body">';
        row += '<div class="user_profile" style="margin-left:10px;padding-top:15px;">';
        row += '<a href="/users/'+articles[i].userName+'" target="_blank"><img src="'+articles[i].avatarUrl+'" alt=""></a></div>';
        row += '<div class="article_title">';
        row += '<a href=\'' + path + '\' target="_blank">' + articles[i].title + '</a>';
        row += '</div>';
        row += '<div class="article_intro">';
        row += '<span style="background-color:rgba(148, 44, 73, 0.5);border-radius:3px;color:white;padding:3px;">' + articles[i].type + '</span>&nbsp;&nbsp;<span class="badge">' + edgexFmtDate(articles[i].created) + '</span>';
        row += '</div></div>';
        $("#index_main div[class='article_list']").append(row);
      }
      // $("#index_main div[class='article_body']").on('click',function(){
      //   var article_id = $(this).attr("article_id");
      //   var article_path =  $(this).attr("article_path");
      //   var rowdata =$(this).attr("rowdata");
      //   window.localStorage.setItem("article_info",rowdata);
      //   window.open("http://"+location.hostname + ":8080/articles/article.html","");
      // });
      footerPosition();
      $(window).resize(footerPosition);
    }

    //footer位置设置
    function footerPosition(){
      $("footer").removeClass("fixed-footer");
      var contentHeight = document.body.scrollHeight ,//网页正文全文高度
       winHeight = window.innerHeight || document.body.clientHeight;//可视窗口高度，不包括浏览器顶部工具栏

      if(contentHeight <= winHeight){

          //当网页正文高度小于等于可视窗口高度时，为footer添加类fixed-footer
          $("footer").addClass("fixed-footer");
          // $(".content").height(winHeight);
      } else {

          $("footer").removeClass("fixed-footer");
      }

    }

    $(document).ready(function(){
      loadNewArticleList();

    });
  </script>
</body>

</html>
